import java.util.Scanner;

public class Test_4_18 {


    //简写单词
    /*public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String string = in.nextLine();
        //按照空格分组
        String str1[] = string.split(" ");
        char[] str2 = new char[str1.length];
        for(int i =0;i< str1.length;i++){
            str2[i] = str1[i].charAt(0);
        }
        for (int i = 0; i < str2.length; i++) {
            if(str2[i]>='a'&&str2[i]<='z'){
                str2[i]-=32;
            }
        }
        System.out.println(str2);
    }*/



/*    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int[] arr = new int[n];
        for(int i =0;i<n;i++){
            arr[i] = in.nextInt();
        }

        int flag1=0;
        int flag2 =n-1;
        for(int i =0;i<n;i++){
            int count = 0;
            for(int j=i;j<n;j++){
                count += arr[j];
                if(count>=x){
                    if((j-i)<(flag2-flag1)){
                        flag1 = i;
                        flag2 = j;
                        break;
                    }
                }
            }
        }
        flag1++;
        flag2++;
        System.out.print(flag1+" "+flag2);
    }*/




    //斐波那契数列
    /*public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int flag1=0;
        int flag2 = 0;
        for(int i = 0;;i++){
            if(Fib(i)<=n&&Fib(i+1)>=n){
                flag1=Fib(i);
                flag2=Fib(i+1);
                break;
            }
        }
        int a1 = n-flag1;
        int a2 = flag2-n;
        if(a1<a2){
            System.out.println(a1);;
        }else{
            System.out.println(a2);
        }
    }

    public static int Fib(int i){
        if(i==0){
            return 0;
        }
        else if(i==1||i==2){
            return 1;
        }else{
            return Fib(i-1)+Fib(i-2);
        }
    }*/


    //单词搜索
    /*public boolean exist (String[] board, String word) {
        // write code here
        boolean[][] arr = new boolean[board.length][board[0].length()];
        for(int i=0;i< board.length;i++){
            for (int j = 0; j <board[0].length() ; j++) {
                if(isExist(board,word,arr,i,j,0)){
                    return true;
                }
            }
        }
        return false;
    }

    public boolean isExist(String[] board,String word,boolean[][] arr2,int i,int j,int index){
        if(i<0||j<0||i>=board.length||j>=board[0].length()||arr2[i][j]){
            return false;
        }
        if(board[i].charAt(j)==word.charAt(index)){
            if(index ==word.length()-1){
                return true;
            }
            arr2[i][j] = true;
            if(isExist(board,word,arr2,i+1,j,index+1)||
            isExist(board,word,arr2,i,j+1,index+1)||
            isExist(board,word,arr2,i-1,j,index+1)||
            isExist(board,word,arr2,i,j-1,index+1)){
                return true;
            }
            arr2[i][j]=false;
            return false;
        }
        return false;
    }*/



    //杨辉三角
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] arr = new int[n][n];
        //每行开头

        for (int i = 0; i <n ; i++) {
            for (int j = 0; j <=i ; j++) {
                if(j==0||j==i){
                    arr[i][j] = 1;
                }else{
                    arr[i][j] = arr[i-1][j-1]+arr[i-1][j];
                }
            }
        }

        //输出
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j <=i; j++) {
                System.out.printf("%5d",arr[i][j]);
            }
            System.out.println();
        }
    }
}
